<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.spoto.oa.model.Sales"%>
<%@ page import="com.spoto.oa.dao.impl.ProductDaoImpl" isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<%
			ProductDaoImpl proDao=new ProductDaoImpl();
			List<String> types=proDao.getType();
			String proType=((Sales)request.getAttribute("sales")).getProduct().getType();
		%>
		<title>修改销售记录</title>
		<script type="text/javascript" src="js/lib/jquery-1.4.2.js"></script>
		<script type="text/javascript" src="js/lib/jquery.validate.js"></script>
		<script src="js/sales/add_sales.js" type="text/javascript"></script>
		<script type='text/javascript' src='dwr/interface/ProductServImpl.js'></script>
		<script type='text/javascript' src='dwr/engine.js'></script>
		<script type='text/javascript' src='dwr/util.js'></script>
		<script type="text/javascript" src="js/ckeditor/ckeditor.js"></script>
		<link href="style/v1/common/form.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<h1>
			修改销售记录
		</h1>
		<form action="SalesServlet?op_type=update&id=${sales.id}" class="form" method="post">
			<div class="must">
				必填:
				<br>
				<hr>
				<ul>
					<li>
						产品类型:
						<select id="proType" name="proType" onchange="refreshProCode()">
							<%
								for(int i=0;i<types.size();i++){
									if(types.get(i).equals(proType)){
							 %>
									<option value="<%=types.get(i) %>" selected= "selected">
										<%=types.get(i) %>
									</option>
							<%
									}else{
							 %>
							 		<option value="<%=types.get(i) %>">
										<%=types.get(i) %>
									</option>
							<%
									}
								}
							%>
						</select>
					</li>
					<li>
						产品编码:
						<select id="proCode" name="proCode" onchange="refreshName()"></select>
					</li>
					<li>
						产品名称:
						<label id="proName"></label>
					</li>
					<li>
						产品实际销售价格:
						<input type="text" name="realPrice" id="realPrice" value="${sales.realPrice}"/>
					</li>
					<li>
						销售产品数量:
						<input type="text" name="numbers" id="numbers" value="${sales.numbers}" />
					</li>		
				</ul>
			</div>
			<div class="other">
				<br>
				<hr>
				<ul>					
					<li>
						备注:
						<textarea name="remarks"></textarea>
					</li>

				</ul>
			</div>
			<ul>
				<li>
					<input type="submit" name="submit" value="提交" />
					<input type="reset" name="reset" value="重置" />
				</li>
			</ul>
		</form>
	</body>
</html>